// 计算机和打印机的相关api
import http from '@/utils/http'

// key对应函数名，value对应api地址
const api = {
  // 新增计算机
  computerAdd: 'printer.computer/add',
  // 编辑修改计算机
  computerEdit: 'printer.computer/edit',
  // 删除计算机
  computerDelete: 'printer.computer/del',
  // 电脑详情
  computerDetail: 'printer.computer/detail',
  // 电脑列表
  computerList: 'printer.computer/list',
  // 获取当前电脑id
  getComputerId: 'printer.computer/getComputerId',
  // 添加打印机
  printerAdd: 'printer.printer/add',
  // 修改打印机
  printerEdit: 'printer.printer/edit',
  // 删除打印机
  printerDelete: 'printer.printer/del',
  // 开启和关闭打印机
  printerSwitch: 'printer.printer/switch',
  // 打印机详情
  printerDetail: 'printer.printer/detail',
  // 打印机列表
  printerList: 'printer.printer/list',
  // 更新门店打印机总设置
  updateShopSetting: 'printer.printer/updateShopSetting',
  // 获取门店打印机总设置
  shopSettingDetail: 'printer.printer/shopSettingDetail',
  // 获取菜品打印机总设置 ||  获取打印单据设置 || 获取打印桌台区域设置
  printerSettingDetail: 'printer.printer/settingDetail',
  // 更新菜品打印机总设置 ||  更新打印单据设置 || 更新打印桌台区域设置
  updatePrinterSetting: 'printer.printer/updateSetting'
}

export function computerAdd(data) {
  return http({
    url: api.computerAdd,
    method: 'post',
    data
  })
}
export function computerEdit(data) {
  return http({
    url: api.computerEdit,
    method: 'post',
    data
  })
}

export function computerDelete(data) {
  return http({
    url: api.computerDelete,
    method: 'post',
    data
  })
}
export function computerDetail(data) {
  return http({
    url: api.computerDetail,
    method: 'post',
    data
  })
}
export function computerList(data) {
  return http({
    url: api.computerList,
    method: 'post',
    data
  })
}
export function getComputerId(data) {
  return http({
    url: api.getComputerId,
    method: 'post',
    data
  })
}
export function printerAdd(data) {
  return http({
    url: api.printerAdd,
    method: 'post',
    data
  })
}
export function printerEdit(data) {
  return http({
    url: api.printerEdit,
    method: 'post',
    data
  })
}
export function printerDelete(data) {
  return http({
    url: api.printerDelete,
    method: 'post',
    data
  })
}
export function printerSwitch(data) {
  return http({
    url: api.printerSwitch,
    method: 'post',
    data
  })
}
export function printerDetail(data) {
  return http({
    url: api.printerDetail,
    method: 'post',
    data
  })
}
export function printerList(data) {
  return http({
    url: api.printerList,
    method: 'post',
    data
  })
}
export function updateShopSetting(data) {
  return http({
    url: api.updateShopSetting,
    method: 'post',
    data
  })
}
export function shopSettingDetail(data) {
  return http({
    url: api.shopSettingDetail,
    method: 'post',
    data
  })
}
export function printerSettingDetail(data) {
  return http({
    url: api.printerSettingDetail,
    method: 'post',
    data
  })
}
export function updatePrinterSetting(data) {
  return http({
    url: api.updatePrinterSetting,
    method: 'post',
    data
  })
}
